﻿using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace MoistureSensorTestApp
{
    public partial class Program
    {

        GT.Timer timer;

        GTM.Seeed.MoistureSensor moistureSensor = new GTM.Seeed.MoistureSensor(10);

        void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:                            
            
            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);             
            ***************************************************************************************** */
            timer = new GT.Timer(1000);
            timer.Tick += new GT.Timer.TickEventHandler(timer_Tick);
            timer.Start();

            // Do one-time tasks here
            Debug.Print("Program Started");
        }

        void timer_Tick(GT.Timer timer)
        {
            Debug.Print(moistureSensor.GetMoistureReading().ToString());
        }
    }
}
